package com.yuanfeng.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanfeng.business.dto.GdbMerchantTransportTemplateDTO;
import com.yuanfeng.business.dto.ShippingInfoDTO;
import com.yuanfeng.business.entity.ShopTransportTemplateEntity;
import com.yuanfeng.business.vo.DealerSetVO;
import com.yuanfeng.business.vo.GdbMerchantTransportTemplateVO;
import com.yuanfeng.business.vo.TransportTemplateListVO;
import com.yuanfeng.commoms.vo.goods.ReceiveGoodsDetailsVO;
import com.yuanfeng.commoms.vo.order.WapShippingQueryResultVO;
import com.yuanfeng.commoms.vo.order.WapShippingTransportResultVO;
import com.yuanfeng.commoms.vo.shop.TransportTemplateVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ShopTransportTemplateMapper
 * @Description 运费模板表
 * @Author cyp
 * @Date 2023-05-29 13:55:18
 * @Version 1.0
 **/
@Mapper
public interface ShopTransportTemplateMapper extends BaseMapper<ShopTransportTemplateEntity> {

    /**
     * 查询供应商经销配置
     *
     * @param name
     * @return
     */
    DealerSetVO queryDealerSet(@Param("key") String name);

    /**
     * 查询商品信息
     * @param goodsIdList
     * @return
     */
    List<WapShippingQueryResultVO> selectShipping2(@Param("goodsList")List<Integer> goodsIdList);

    /**
     * 查询运费模板
     * @param transportTemplateId
     * @return
     */
    WapShippingTransportResultVO selectShippingByTemple(@Param("transportTemplate")Integer transportTemplateId);

    /**
     * 查询模板信息
     * @param supplierGoodsId
     * @return
     */
    Map<String, Object> queryByGoodsId(@Param("goodsId")Integer supplierGoodsId);

    /**
     * 查询商品goodId
     * @param commonId
     * @return
     */
    Integer queryFxGuigeGoodsId(@Param("commonId")Integer commonId);

    /**
     * 查询当前商品是否是虚拟商品
     * @param goodsId
     * @return
     */
    Integer queryVirtualGoods(Integer goodsId);

    /**
     * 查询模板信息
     * @param id
     * @return
     */
    List<WapShippingTransportResultVO> selectShipping(@Param("transportTemplateId")Integer id);


    /**
     * 查询运费
     *
     * @param goodsId
     * @return
     */
    ShippingInfoDTO selectShippingInfo(@Param("goodsId") Integer goodsId);

    /**
     * 查询商品信息
     * @param goodsId
     * @return
     */
    ReceiveGoodsDetailsVO selectCartMessage(@Param("goodsId")Integer goodsId);

    /**
     * 查询运费模板列表
     *
     * @param shopId
     * @return
     */
    List<TransportTemplateListVO> selectByShopId2(@Param("shopId")Integer shopId);

    /**
     * 删除运费模板
     *
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 修改模板
     * @param param
     * @return
     */
    int updateByPrimaryKeySelective(@Param("param") GdbMerchantTransportTemplateDTO param);

    /**
     * 添加包邮区域内运费规则
     * @param record
     * @return
     */
    int insertSelective(GdbMerchantTransportTemplateDTO record);

    /**
     * 查询
     * @param id
     * @return
     */
    GdbMerchantTransportTemplateVO selectByPrimaryKey(Integer id);


    /**
     * 通过店铺id查询
     *
     * @param shopId
     * @return
     */
    List<TransportTemplateVO> selectByShopId(@Param("shopId") Integer shopId);
}
